<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    button{
       color: pink;
        width: 120px;
        height: 50px;
        margin-left: 200px;
        display: block;
    }
</style>
<body>
    <button>点击开始抽奖哟</button>
    <script>
    //    编写一个函数 ，输入一个数字，返还数字的长度
    // function sum(fan){
    //     return fan.toString().length
    // }
    // var res=sum('faas')
    // console.log(res)

// 随机数
var but=document.querySelector('button')
but.onclick=function(){
   
    var num = parseInt( Math.random()*(11-1));
    document.write(num)
   
}

















    </script>
</body>
</html>